/** @format */

const express = require("express");
const AppRouter = require("./service/router");
const cors = require('cors')

const app = express();

const path = 2001;

// app.use(express.urlencoded({ extended: false }));

app.use (express.json ());   // post 必须加这句 否则后端接收不到数据

app.use(cors());  

app.use("/", AppRouter); 


app.listen(path, () => console.log(`后端服务器启动，端口号--${path}`)); 
 